/**
 * 
 */
package com.dalonedrow.module.hq.systems;

import com.dalonedrow.engine.sprite.base.SimpleVector3;
import com.dalonedrow.engine.systems.base.Interactive;
import com.dalonedrow.globalvariables.constants.hq.GlobalConstants;
import com.dalonedrow.module.hq.rpg.HQInteractiveObject;
import com.dalonedrow.rpg.base.flyweights.DamageInfo;
import com.dalonedrow.rpg.base.systems.Damages;

/**
 * @author Donald
 *
 */
public final class HQDamages implements Damages<HQInteractiveObject> {
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void addScreenSplat(SimpleVector3 pos, float dmg) {
		// TODO Auto-generated method stub
		
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void addVisual(DamageInfo di, SimpleVector3 pos, float dmg,
			HQInteractiveObject io) {
		// TODO Auto-generated method stub
		
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public float damageNPC(int target, float dmg, int source, long flags,
			SimpleVector3 pos) {
		// TODO Auto-generated method stub
		return 0;
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void damageFIX(HQInteractiveObject io, float dmg, long source,
			long flags, SimpleVector3 pos) {
		// TODO Auto-generated method stub
		
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void damagePlayer(int target, float dmg, long type, int source,
			SimpleVector3 pos) {
		// TODO Auto-generated method stub
		
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public float dealDamages(long target, float dmg, long source, long flags,
			SimpleVector3 pos) {
		// TODO Auto-generated method stub
		return 0;
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public float drainMana(HQInteractiveObject io, float dmg) {
		// TODO Auto-generated method stub
		return 0;
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void forceDeath(HQInteractiveObject io_dead,
			HQInteractiveObject io_killer) {
		// TODO Auto-generated method stub
		
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public long getFreeIndex() {
		// TODO Auto-generated method stub
		return 0;
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void healInter(HQInteractiveObject io, float dmg) {
		// TODO Auto-generated method stub
		
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void healManaInter(HQInteractiveObject io, float dmg) {
		// TODO Auto-generated method stub
		
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void healManaPlayer(long target, float dmg) {
		// TODO Auto-generated method stub
		
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void healPlayer(long target, float dmg) {
		// TODO Auto-generated method stub
		
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public long inExceptList(long dmg, long num) {
		// TODO Auto-generated method stub
		return 0;
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void initScreenSplats() {
		// TODO Auto-generated method stub
		
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void renderBloodSpatter() {
		// TODO Auto-generated method stub
		
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void reset() {
		// TODO Auto-generated method stub
		
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void resetBloodInfo() {
		// TODO Auto-generated method stub
		
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void updateAll() {
		// TODO Auto-generated method stub
		
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void updateDamage(long j, float tim) {
		// TODO Auto-generated method stub
		
	}
	/** the one and only instance of the <code>HQDamages</code> class. */
	private static HQDamages	instance;
	/**
	 * Gives access to the singleton instance of {@link HQDamages}.
	 * @return {@link HQDamages}
	 */
	public static HQDamages getInstance() {
		if (HQDamages.instance == null) {
			HQDamages.instance = new HQDamages();
		}
		return HQDamages.instance;
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public float computeRepairPrice(final HQInteractiveObject torepair,
			final HQInteractiveObject blacksmith) {
		// NOT USED
		return 0;
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void damagePlayerEquipment(final int target, final float damages) {
		// NOT USED
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void durabilityLoss(final HQInteractiveObject io, final float loss) {
		// NOT USED
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void durabilityCheck(final HQInteractiveObject io, 
			final float ratio) {
		// NOT USED
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void durabilityRestore(final HQInteractiveObject io, 
			final float percent) {
		// NOT USED
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void pushPlayer(final SimpleVector3 pos, final float intensity) {
		// NOT USED
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public void checkForIgnition(final SimpleVector3 pos, final float radius, 
			final long mode, final long flag) {
		// NOT USED
	}
	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean tryToDoDamage(final SimpleVector3 pos, final float dmg, 
			final float radius, final long source) throws Exception {
		boolean ret = false;
		for (int i = 0; i < Interactive.getInstance().getNumberIOs(); i++) {
			if (Interactive.getInstance().hasIO(i)) {
				HQInteractiveObject hio = 
					(HQInteractiveObject) DQInteractive.getInstance().getIO(i);
				if (hio.hasGameFlag(GlobalConstants.GFLAG_ISINTREATZONE)) {
					if (hio.getShow() == GlobalConstants.SHOW_FLAG_IN_SCENE) {
						if (source != i) {
							float threshold;
							float rad = radius + 5.f;

							if (hio.hasIOFlag(GlobalConstants.IO_04_FIX)) {
								threshold = 510;
								rad += 10.f;
							} else if (hio.hasIOFlag(GlobalConstants.IO_03_NPC)) {
								threshold = 250;
							} else {
								threshold = 350;
							}
							/*
							if (EEDistance3D(pos, &io->pos) < threshold)
								if (SphereInIO(io, pos, rad))
								{
									if (io->ioflags & IO_NPC)
									{
										if (ValidIONum(source))
											ARX_EQUIPMENT_ComputeDamages(inter.iobj[source], NULL, io, 1.f);

										ret = TRUE;
									}

									if (io->ioflags & IO_FIX)
									{
										ARX_DAMAGES_DamageFIX(io, dmg, source, 0);
										ret = TRUE;
									}
								}
								*/
						}
					}
				}
			}
		}

		return ret;
	}
}
